package pers.gxm.abstractfactory.factory;

import java.util.ArrayList;

public abstract class Tray extends Item{
    protected ArrayList<Item> tray = new ArrayList<>();
    public Tray(String caption) {
        super(caption);
    }

    public void add(Item item){
        item.increaseElementLevel();
        tray.add(item);
    }

    @Override
    public void increaseElementLevel() {
        elementLevel+=2;
        for(Item it : tray){
            it.increaseElementLevel();
        }
    }


}
